static void gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
GtkMenuDirectionType direction);
-static GtkShadowType get_shadow_type (GtkMenuBar *menubar);
-
G_DEFINE_TYPE_WITH_PRIVATE (GtkMenuBar, gtk_menu_bar, GTK_TYPE_MENU_SHELL)
static void
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ /**
+ * GtkMenuBar:shadow-type:
+ *
+ * The style of the shadow around the menubar.
+ *
+ * Deprecated: 3.20: Use CSS to determine the shadow; the value of
+ * this style property is ignored.
+ */
gtk_widget_class_install_style_property (widget_class,
g_param_spec_enum ("shadow-type",
P_("Shadow type"),
*minimum += border_width * 2;
*natural += border_width * 2;
- if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
- {
- gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
+ gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- *minimum += border.left + border.right;
- *natural += border.left + border.right;
- }
- else
- {
- *minimum += border.top + border.bottom;
- *natural += border.top + border.bottom;
- }
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ *minimum += border.left + border.right;
+ *natural += border.left + border.right;
+ }
+ else
+ {
+ *minimum += border.top + border.bottom;
+ *natural += border.top + border.bottom;
}
}
remaining_space.height = allocation->height -
2 * border_width - border.top - border.bottom;
- if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
- {
- gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
+ gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
+
+ remaining_space.x += border.left;
+ remaining_space.y += border.top;
+ remaining_space.width -= border.left + border.right;
+ remaining_space.height -= border.top + border.bottom;
- remaining_space.x += border.left;
- remaining_space.y += border.top;
- remaining_space.width -= border.left + border.right;
- remaining_space.height -= border.top + border.bottom;
- }
-
requested_sizes = g_array_new (FALSE, FALSE, sizeof (GtkRequestedSize));
if (priv->pack_direction == GTK_PACK_DIRECTION_LTR ||
gtk_widget_get_allocated_width (widget) - border * 2,
gtk_widget_get_allocated_height (widget) - border * 2);
- if (get_shadow_type (GTK_MENU_BAR (widget)) != GTK_SHADOW_NONE)
- gtk_render_frame (context, cr,
- border, border,
- gtk_widget_get_allocated_width (widget) - border * 2,
- gtk_widget_get_allocated_height (widget) - border * 2);
+ gtk_render_frame (context, cr,
+ border, border,
+ gtk_widget_get_allocated_width (widget) - border * 2,
+ gtk_widget_get_allocated_height (widget) - border * 2);
GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->draw (widget, cr);
g_signal_emit_by_name (to_activate, "activate_item");
}
-static GtkShadowType
-get_shadow_type (GtkMenuBar *menubar)
-{
- GtkShadowType shadow_type = GTK_SHADOW_OUT;
-
- gtk_widget_style_get (GTK_WIDGET (menubar),
- "shadow-type", &shadow_type,
- NULL);
-
- return shadow_type;
-}
-
static gint
gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell)
{